import defaultData from "./data";
import { WeaInput, WeaCheckbox, WeaLocaleProvider, WeaHelpfulTip } from 'ecCom';
import { Row } from "antd";
import Props from "../base/Props";
import DefaultVal from '../../../../common/default-value';

const getLabel = WeaLocaleProvider.getLabel;

export default class InputProps extends Props {
  renderDefaultValue() {
    const { data } = this.props;
    const { defaultValue } = data;

    return (
      <DefaultVal ecId={`${this && this.props && this.props.ecId || ''}_DefaultVal@4z9d7e`}
        helpfulTip={getLabel(521080 , '系统变量转换后，只能保存100个字符，超过将自动截取前100个字符')} 
        value={defaultValue}
        onChange={super.handlePropChange('defaultValue')}
      />
    );
  }

  _renderVerifyContent() {
    this.props.data.max.limit = 100;
    const { IDcardVerification } = this.props.data;
    return (
      <React.Fragment ecId={`${this && this.props && this.props.ecId || ''}_Fragment@pn1exg`}>
        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@gu7i1d`}>
          <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@s9x4wj`}
            content={getLabel('511625','身份证号验证')}
            value={IDcardVerification}
            onChange={this.handlePropChange('IDcardVerification')}
          />
          <WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@9ceopx`} 
          title={`<div>${getLabel('511757','勾选后，此处身份证验证只校验是否符合规定的身份证号格式，无法验证该号码真伪') }</div>`}
          placement="topRight"
          />
        </Row>
      </React.Fragment>
    )
  }
}

InputProps.defaultProps = {
  data: defaultData
};